The operators <>
and !=
are equivalent. However, the <>
operator is considered obsolete in
Python 2.7 and has been removed from Python 3. Therefore, it is recommended to use !=
instead.
Code examples
Noncompliant code example
return a <> b # Noncompliant: the operator "<>" is deprecated.
Compliant solution
return a != b